import { mock as mockFn } from "/@/api/mock/index";
const DEALY_TIME = 500;
export const mock = {
  get: (url, config) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockFn({ url, config }, "get"));
      }, DEALY_TIME);
    });
  },
  post: (url, data, config) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockFn({ url, config, data }, "post"));
      }, DEALY_TIME);
    });
  },
  put: (url, data, config) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockFn({ url, config, data }, "put"));
      }, DEALY_TIME);
    });
  },
  delete: (url, config) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(mockFn({ url, config }, "delete"));
      }, DEALY_TIME);
    });
  },
};
